//
//  AWSEC2Instance+Extension.m
//  AWSMobile
//
//  Created by James on 14-11-5.
//  Copyright (c) 2014年 Siemens. All rights reserved.
//

#import "AWSEC2Instance+Extension.h"
#import "AMFunctions.h"

@implementation AWSEC2Instance (Extension)

- (NSString *)typeName
{
    NSString *typeName;
    switch (self.instanceType)
    {
        case AWSEC2InstanceTypeC1_medium:
            typeName = @"c1.medium";
            break;
        case AWSEC2InstanceTypeC1_xlarge:
            typeName = @"c1.xlarge";
            break;
        case AWSEC2InstanceTypeC3_2xlarge:
            typeName = @"c3.2xlarge";
            break;
        case AWSEC2InstanceTypeC3_4xlarge:
            typeName = @"c3.4xlarge";
            break;
        case AWSEC2InstanceTypeC3_8xlarge:
            typeName = @"c3.8xlarge";
            break;
        case AWSEC2InstanceTypeC3_large:
            typeName = @"c3.large";
            break;
        case AWSEC2InstanceTypeC3_xlarge:
            typeName = @"c3.xlarge";
            break;
        case AWSEC2InstanceTypeCC1_4xlarge:
            typeName = @"cc1.4xlarge";
            break;
        case AWSEC2InstanceTypeCC2_8xlarge:
            typeName = @"cc2.8xlarge";
            break;
        case AWSEC2InstanceTypeCG1_4xlarge:
            typeName = @"cg1.4xlarge";
            break;
        case AWSEC2InstanceTypeCR1_8xlarge:
            typeName = @"cr1.8xlarge";
            break;
        case AWSEC2InstanceTypeG2_2xlarge:
            typeName = @"g2.2xlarge";
            break;
        case AWSEC2InstanceTypeHI1_4xlarge:
            typeName = @"hi1.4xlarge";
            break;
        case AWSEC2InstanceTypeHS1_8xlarge:
            typeName = @"hs1.8xlarge";
            break;
        case AWSEC2InstanceTypeI2_2xlarge:
            typeName = @"i2.2xlarge";
            break;
        case AWSEC2InstanceTypeI2_4xlarge:
            typeName = @"i2.4xlarge";
            break;
        case AWSEC2InstanceTypeI2_8xlarge:
            typeName = @"i2.8xlarge";
            break;
        case AWSEC2InstanceTypeI2_xlarge:
            typeName = @"i2.xlarge";
            break;
        case AWSEC2InstanceTypeM1_large:
            typeName = @"m1.large";
            break;
        case AWSEC2InstanceTypeM1_medium:
            typeName = @"m1.medium";
            break;
        case AWSEC2InstanceTypeM1_small:
            typeName = @"m1.small";
            break;
        case AWSEC2InstanceTypeM1_xlarge:
            typeName = @"m1.xlarge";
            break;
        case AWSEC2InstanceTypeM2_2xlarge:
            typeName = @"m2.2xlarge";
            break;
        case AWSEC2InstanceTypeM2_4xlarge:
            typeName = @"m2.4xlarge";
            break;
        case AWSEC2InstanceTypeM2_xlarge:
            typeName = @"m2.xlarge";
            break;
        case AWSEC2InstanceTypeM3_2xlarge:
            typeName = @"m3.2xlarge";
            break;
        case AWSEC2InstanceTypeM3_large:
            typeName = @"m3.large";
            break;
        case AWSEC2InstanceTypeM3_medium:
            typeName = @"m3.medium";
            break;
        case AWSEC2InstanceTypeM3_xlarge:
            typeName = @"m3.xlarge";
            break;
        case AWSEC2InstanceTypeR3_2xlarge:
            typeName = @"r3.2xlarge";
            break;
        case AWSEC2InstanceTypeR3_4xlarge:
            typeName = @"r3.4xlarge";
            break;
        case AWSEC2InstanceTypeR3_8xlarge:
            typeName = @"r3.8xlarge";
            break;
        case AWSEC2InstanceTypeR3_large:
            typeName = @"r3.large";
            break;
        case AWSEC2InstanceTypeR3_xlarge:
            typeName = @"r3.xlarge";
            break;
        case AWSEC2InstanceTypeT1_micro:
            typeName = @"t1.micro";
            break;
        case AWSEC2InstanceTypeT2_medium:
            typeName = @"t2.medium";
            break;
        case AWSEC2InstanceTypeT2_micro:
            typeName = @"t2.micro";
            break;
        case AWSEC2InstanceTypeT2_small:
            typeName = @"t2.small";
            break;
        default:
            typeName = @"unknown";
            break;
    }
    return typeName;
}

- (NSString *)stateName
{
    NSString *stateName;
//    NSDictionary *attri = @{NSForegroundColorAttributeName:[UIColor colorWithHexString:@"656565"]};
    switch (self.state.name)
    {
        case AWSEC2InstanceStateNamePending:
            stateName = @"pending";
//            attri = @{NSForegroundColorAttributeName:[UIColor blueColor]};
            break;
        case AWSEC2InstanceStateNameRunning:
            stateName = @"running";
//            attri = @{NSForegroundColorAttributeName:[UIColor colorWithHexString:@"5aa4eb"]};
            break;
        case AWSEC2InstanceStateNameShuttingDown:
            stateName = @"shutting down";
//            attri = @{NSForegroundColorAttributeName:[UIColor colorWithHexString:@"fe93bf"]};
            break;
        case AWSEC2InstanceStateNameStopped:
            stateName = @"stopped";
//            attri = @{NSForegroundColorAttributeName:[UIColor colorWithHexString:@"fe93bf"]};
            break;
        case AWSEC2InstanceStateNameStopping:
            stateName = @"stopping";
//            attri = @{NSForegroundColorAttributeName:[UIColor colorWithHexString:@"fe93bf"]};
            break;
        case AWSEC2InstanceStateNameTerminated:
            stateName = @"terminated";
            break;
            
        default:
            stateName = @"unknown";
            break;
    }
    return stateName;
}


@end
